Add format=original query parameter to download URLs#8
Add format=original query parameter to download URLs#8ThexXTURBOXx wants to merge 2 commits intoFTB-Gamepedia:masterfrom
format=original query parameter to download URLs#8Conversation
| let lossy_url = image["imageinfo"][0]["url"] | ||
| .as_str() | ||
| .ok_or_else(|| Error::Json(image.clone()))?; | ||
| let url = format!("{}{}format=original", lossy_url, |
There was a problem hiding this comment.
It looks like we can probably add a line like this to make this simpler:
request.arg("format", "original");Probably add it around https://github.com/FTB-Gamepedia/mediawiki-rs/pull/8/changes#diff-b1a35a68f14e696205874893c07fd24fdb88882b47c23cc0e0c80a30c7d53759R152-R153 if I were to choose, but anywhere before the actual request happens should be fine.
There was a problem hiding this comment.
The argument is not going on that request, because that's the request to get the image URL in the first place. It has to be added to the later request where we actually download the image.
There was a problem hiding this comment.
I agree that my approach of using format to append a string is not the best way. I have not done too much with Rust yet, so sorry if I don't know about every API method there is!
But yeah, @retep998 is right: the format=original parameter needs to be added to this request, not the one before, where only the JSON is being fetched
This is needed because
webpfiles may be downloaded otherwise.Now, the original file is actually retrieved.